﻿@model throneOfGames.Models.ProfileViewModel
@{
    ViewBag.Title = "ViewProfile";
    Layout = "~/Views/Shared/_Layout.cshtml";
}

@section featured {
    <section class="featured">
        <div class="content-wrapper">
            <hgroup class="title">
                <h1>@ViewBag.Title.</h1>
                <h2>@ViewBag.Message</h2>
            </hgroup>
        </div>
    </section>
}

<div id="site-container">
    <div id="public-chat">
        <h3>Chat</h3>
        @Html.Partial("_chat")
        @section Scripts
         {
            @Html.Partial("_ChatScript")
        }
    </div>

    <div id="leaderboard">
        <h3>Leaderboard</h3>
        <ul class="nav">
            <li class="nav1"><a href="#kof" class="selected">King of Tokyo</a></li>
            <li class="nav2"><a href="#ttt" class="unSelected">Tic Tac Toe</a></li>
        </ul>
        <ol>
            @foreach (var l in @Model.leaderboardData)
            {
                if(l.Leaderboard.Boardgame.name == "TicTacToe")
                {
                    <li class="TTTLeaderboard">@l.User.userName: @l.score</li>
                }
                else if (l.Leaderboard.Boardgame.name == "King of Tokyo")
                {
                    <li class="KoTLeaderboard">@l.User.userName: @l.score</li>
                }
            }
        </ol>
    </div>

    <div id="main-container">
        <p>This is the main container.</p>
        <form name="profileEditForm" id="profileEditForm" action="/User/EditProfile">
            <p>
                <input type="hidden" name="idField" value="@Model.theUser.ID" /></p>
            <p id ="winloss">Win/Loss ratio: @Model.theUser.gameWins/@Model.theUser.gameLosses</p>
            <p>Name: <input type="text" name="nameField" id="nameField" value="@Model.theUser.userName" /></p>
            <p>Email: <input type="text" name="emailField" id="emailField" value="@Model.theUser.email" /></p>
            <p>Password: <input type="password" name="passwordField" id="passwordField" value="Password" /></p>
            <p>
                <input type="submit" value="Save" class="editProfile" /></p>
        </form>
    </div>
    
    @Scripts.Render("~/Scripts/editProfile.js")
</div>